package whf.framework.security.entity;

import whf.framework.entity.Permissionable;
import whf.framework.entity.TreeNode;

/**
 * @author wanghaifeng
 *
 */
public class Dept extends whf.framework.entity.AbstractEntity implements TreeNode<Dept>, Permissionable{

	private static final long serialVersionUID = 0;

	/**
	 * 上级部门
	 * @property Dept:parent
	 */
	private Dept parent;
	
	private Permission permission;
	
	private User leader;
	
	private String type;
	
	private String linkman;
	
	private String telephone;
	
	private String fax;
	
	private String email;
	
	private String address;
	
	private String postalCode;
	
	private String branch;
	
	public Dept getParent() {
		return parent;
	}

	public void setParent(Dept parent) {
		this.parent = parent;
	}

	public Permission getPermission() {
		return permission;
	}

	public void setPermission(Permission permission) {
		this.permission = permission;
	}

	public User getLeader() {
		return leader;
	}

	public void setLeader(User leader) {
		this.leader = leader;
	}

	@Override
	public String getDisplayName() {
		if(this.getParent() != null) {
			return this.getParent().getDisplayName() + "/" + this.getName();
		} else {
			return "/" + this.getName();
		}
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getLinkman() {
		return linkman;
	}

	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getBranch() {
		return branch;
	}

	public void setBranch(String branch) {
		this.branch = branch;
	}

}